<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');?>
<?php $this->load->view('common/head');?>

<?php $this->load->view('common/header');?>
<div class="main-container" id="main-container">
    <script type="text/javascript">
        try {
            ace.settings.check('main-container', 'fixed')
        } catch (e) {
        }
    </script>

    <?php $this->load->view('common/sidebar');?>
    <div class="main-content">
        <div class="main-content-inner">
            <!-- #section:basics/content.breadcrumbs -->
            <?php $this->load->view('common/breadcrumbs');?>

            <!-- /section:basics/content.breadcrumbs -->
            <div class="page-content">

                <?php $this->load->view('common/set');?>

                <!-- /section:settings.box -->
                <div class="row">
                    <div class="col-xs-12">
                        <!-- PAGE CONTENT BEGINS -->
                        <form class="form-horizontal" action="" method="post">
						<?php echo csrf_hidden();?>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-1"> 用户名 </label>
                                <div class="col-sm-9">
                                    <input type="text" readonly class="rcol-xs-10 col-sm-5" value="<?php if(isset($member)){ echo $member["user_name"];}?>">
                                    <input type="hidden" name="user_id" value="<?php if(isset($member)){ echo $member["user_id"];}?>">
                                            <span class="help-inline col-xs-12 col-sm-7">
											    <span class="middle">此项无法修改</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>

                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-6"> 电话号码 </label>
                                <div class="col-sm-9">
                                    <input type="text" readonly id="user_tel" placeholder="电话号码"
                                           class="col-xs-10 col-sm-5" value="<?php if(!empty($member['user_tel'])){  echo $member['user_tel'];}?>">
                                            <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">此项无法修改</span>
											</span>
                                </div>
                            </div>

                            <div class="space-4"></div>
                            <div class="form-group">
                                <label class="col-sm-1 control-label no-padding-right" for="form-field-8">销售贷额度</label>
                                <div class="col-sm-9">
                                    <input type="text" name="user_money" id="user_money" placeholder="销售贷余额"
                                           class="col-xs-10 col-sm-5" value="<?php if(!empty($member['user_money'])){ echo $member['user_money'];};?>">
                                    <span class="help-inline col-xs-12 col-sm-7">
												<span class="middle">更改此项会记录当前操作人,请谨慎操作</span>
											</span>
                                </div>
                            </div>
                            <div class="space-4"></div>
                        </form>
                        <input type="hidden" id="uid" name="uid" value="<?php if(!empty($member['user_id'])){  echo $member['user_id'];}?>">
                        <div class="col-md-offset-2 col-md-9">
                            <span class="btn btn-purple btn-sm set_edu" action="2">
                                <span class=" icon-on-right bigger-110"></span>
                                确定设置
                            </span>
                        </div>
                        <!-- PAGE CONTENT ENDS -->
                    </div><!-- /.col -->
                </div><!-- /.row -->
            </div><!-- /.page-content -->
        </div>
    </div><!-- /.main-content -->
    <?php $this->load->view('common/footer');?>
</div><!-- /.main-container -->

<?php $this->load->view('common/footerjs');?>
<!-- inline scripts related to this page -->
<script type="text/javascript">
    $(function () {

        $(".set_edu").click(function(){
            var uid = $("#uid").val();
            var user_money = $("#user_money").val();
            var locationurl = baseurl+"index.php/manage/member/set_edu_action";
            $.ajax({
                url:locationurl,
                type:"get",
                data:{'uid':uid,"user_money":user_money},
                dataType: 'json',
                success: function(data){
                    console.log(data);
                    if(data.code == 200){
                        layer.msg('销售贷设置成功', {
                            time: 1000, //1s后自动关闭
                            shade: 0.1
                        },function () {
                            window.location.href = "<?php echo site_url(X_URL.'member/users');?>";
                        });
                    }else{
                        console.log(data);
                        layer.msg(data.msg);
                    }
                }
            });
        });

    });


</script>
</body>
</html>
